//#include<bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	unsigned long long n, s, l;
	unsigned long long tree[200005] = { 0 };
	cin >> n >> s >> l;
	unsigned long long count = 0;
	if (s % l != 0)count = s / l + 1;
	else count = s / l;
	priority_queue<int, vector<int>, greater<int>>pq;
	for (int i = 0;i < n;i++)cin >> tree[i];
	for (int i = 0;i < n;i++){
		unsigned long long tmp;
		cin >> tmp;
		if (tree[i] >= l)
		{
			pq.push(0); 
			continue;
		}
		if ((l - tree[i]) % tmp != 0)
			pq.push((l - tree[i]) / tmp + 1);
		else
			pq.push((l - tree[i]) / tmp);
	}

	while (count--!=1) pq.pop();
	cout << pq.top() << endl;
	return 0;
}

